package com.ruoyi.business.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.compress.utils.Lists;
import org.springframework.core.io.FileSystemResource;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class WaterEnvTaskVO implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;

    /**
     * 任务名称
     */
    private String taskName;

    /**
     * 调研水体名称
     */
    private String surveyWaterBodyName;

    /**
     * 业务类别
     */
    private String businessType;

    /**
     * 任务描述
     */
    private String taskRemark;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

//    private MultipartFile file;

    private String createBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 备注
     */
    private String remark;

    private List<TaskUserVO> userList = Lists.newArrayList();
    private List<TaskPointVO> taskPointSList = Lists.newArrayList();
    private List<TaskSurveyVO> taskSurveyList = Lists.newArrayList();
    private List<TaskAnnexVO> taskAnnexList = Lists.newArrayList();


//    public MultiValueMap<String, Object> toMap(File file) throws IllegalAccessException {
//        MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
//        map.add("userList", userList);
//        map.add("taskPointSList", taskPointSList);
//        map.add("taskSurveyList", taskSurveyList);
//        map.add("taskAnnexList", taskAnnexList);
//        map.add("remark", remark);
//        map.add("taskName", taskName);
//        if(file != null) {
//            map.add("file", new FileSystemResource(file));
//        }
//        return map;
//    }
}
